<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="template.xhtml">
	<ui:define name="principal">

		<h:form id="frmRelatorios">

			<h:panelGrid columns="2" style="width:100%">
				<p:column style="height:200px;">
					<p:fieldset legend="Por Dia">
						<p:selectOneRadio id="rel" value="#{relatorioMB.relatorio}" layout="pageDirection">
							<f:selectItems value="#{relatorioMB.relatorios}" itemLabel="#{relatorio}" itemValue="#{relatorio}" />
							<p:ajax event="click" update="frmRelatorios:paramData" />
						</p:selectOneRadio>
						<br />
						<h:panelGrid id="paramData" columns="1">
							<p:outputLabel value="Data" />
							<p:calendar id="data" value="#{relatorioMB.data}" locale="pt" pattern="dd/MM/yyyy" />
							<br />
							<f:facet name="footer">
								<h:commandLink target="_blank" action="#{relatorioMB.gerarRelatorio()}" value="Imprimir Relatório" />
							</f:facet>
						</h:panelGrid>
					</p:fieldset>
				</p:column>
				<p:column style="height:200px;">
					<p:fieldset legend="Por Período">
						<p:selectOneRadio id="rel1" value="#{relatorioMB.relatorioPorPeriodo}" layout="pageDirection">
							<f:selectItems value="#{relatorioMB.relatoriosPorPeriodo}" itemLabel="#{relatorioPorPeriodo}" itemValue="#{relatorioPorPeriodo}" />
							<p:ajax event="click" update="frmRelatorios:paramDatas" />
						</p:selectOneRadio>
						<br />
						<p:spacer height="22px" />
						<h:panelGrid id="paramDatas" columns="2">
							<p:outputLabel value="Data Inicial" />
							<p:outputLabel value="Data Final" />
							<p:calendar id="dataInicial" value="#{relatorioMB.dataInicial}" locale="pt" pattern="dd/MM/yyyy" />
							<p:calendar id="dataFinal" value="#{relatorioMB.dataFinal}" locale="pt" pattern="dd/MM/yyyy" />
						</h:panelGrid>
						<br />
						<h:panelGrid>
							<f:facet name="footer">
								<h:commandLink target="_blank" action="#{relatorioMB.gerarRelatorioPorPeriodo()}" value="Imprimir Relatório" />
							</f:facet>
						</h:panelGrid>
					</p:fieldset>
				</p:column>
			</h:panelGrid>

		</h:form>

	</ui:define>
</ui:composition>

</html>